<admintpl file="header" />
<link href="/public/qiniu/css/formdata.css" rel="stylesheet">
<script src="/public/qiniu/js/jquery/jquery.min.js"></script>

<script src="/public/qiniu/js/formdata.js"></script>
</head>
<body>
<div class="wrap">
	<ul class="nav nav-tabs">
		<li ><a href="{:U('Video/index')}">视频列表</a></li>
		<li class="active"><a >视频编辑</a></li>
	</ul>
	<form method="post"  id="testform"  class="form-horizontal js-ajax-form" action="{:U('Video/edit_post')}">
		<fieldset>
			<input type="hidden" name="id" value="{$info.id}">
			<input type="hidden" name="type" value="{$info.type}">
			<div class="control-group">
				<label class="control-label">视频名称</label>
				<div class="controls">
					<input type="text" name="name" value="{$info.name}">
					<span class="form-required">*</span>
				</div>
			</div>
			<div class="control-group">
				<label class="control-label">视频封面图片</label>
				<div class="controls">
					<div>
						<input type="hidden" name="thumb2" id="thumb2" value="{$info.thumb2}">
						<a href="javascript:void(0);" onclick="flashupload('thumb_images', '附件上传','thumb2',thumb_images,'1,jpg|jpeg|gif|png|bmp,1,,,1','','','');return false;">
							<if condition="$info['thumb2'] neq ''">
								<img src="{$info['thumb2']}" id="thumb2_preview" width="135" style="cursor: hand" />
								<else/>
							<img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb2_preview" width="135" style="cursor: hand" />
							</if>
						</a>
						<input type="button" class="btn btn-small" onclick="$('#thumb2_preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb2').val('');return false;" value="取消图片">
					</div>
					<span class="form-required"></span>
				</div>
			</div>


			<div class="control-group">
				<label class="control-label">是否收费</label>
				<div class="controls">
					<label class="radio inline" for="is_charge_0"><input type="radio" name="is_charge" value="0" id="is_charge_0" <if condition="$info['is_charge'] eq '0'">checked</if>>否</label>
					<label class="radio inline" for="is_charge_1"><input type="radio" name="is_charge" value="1" id="is_charge_1" <if condition="$info['is_charge'] eq '1'">checked</if> >是</label>
				</div>
			</div>
			<div class="control-group"  id="is_charge" <if condition="$info['is_charge'] eq '0'">style="display: none"</if>>
				<label class="control-label">所需钻石</label>
				<div class="controls">
					<input type="text" name="charge_money" value="{$info['charge_money']}">
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">是否支持下载</label>
				<div class="controls">
					<label class="radio inline" for="is_down_1"><input type="radio" name="is_down" value="0" id="is_down_1" <if condition="$info['is_down'] eq '0'">checked</if>>否</label>
					<label class="radio inline" for="is_down_2"><input type="radio" name="is_down" value="1" id="is_down_2" <if condition="$info['is_down'] eq '1'">checked</if> >是</label>
				</div>
			</div>
			<div class="control-group" id="is_down" <if condition="$info['is_down'] eq '0'">style="display:none"</if> >
				<label class="control-label">所需钻石</label>
				<div class="controls">
					<input type="text" name="down_money" value="{$info['down_money']}">
				</div>
			</div>

	<!--		<div class="control-group">
				<label class="control-label">是否推荐</label>
				<div class="controls">
					<label class="radio inline" for="is_recommend1"><input type="radio" name="is_recommend" value="0" id="is_recommend1" <if condition="$info['is_recommend'] eq '0'">checked</if>>否</label>
					<label class="radio inline" for="is_recommend2"><input type="radio" name="is_recommend" value="1" id="is_recommend2" <if condition="$info['is_recommend'] eq '1'">checked</if> >是</label>
				</div>
			</div>-->

			<div class="control-group">
				<label class="control-label">播放次数</label>
				<div class="controls">
					<input type="text" name="times" value="{$info.times}">
				</div>
			</div>

			<div class="control-group" id="detail" >
				<label class="control-label">视频简介</label>
				<div class="controls">
					<textarea name="detail" rows="10" cols="100" style="width: 400px;height: 100px">{$info.detail}</textarea>
				</div>
			</div>

			<div class="control-group">
				<label class="control-label">视频</label>
				<div class="controls">
					<script>
                        var domain = "http://p18j352br.bkt.clouddn.com"; // you bucket domain  eg: http://xxx.bkt.clouddn.com
					</script>
					<!--<form  method="post" enctype="multipart/form-data">-->
					<input name="key" id="key" type="hidden" value="{$info.qiniu_key}">
					<input name="filekey" id="filekey" type="hidden" value="{$info.video_path}">
					<input name="qiniukey" id="qiniukey" type="hidden" value="{$info.qiniu_key}">
					<input name="token" type="hidden" value="{$token}">
					<a href="javascript:;" class="file">选择文件
						<input id="userfile" name="file" type="file" />
					</a>

					<!-- take photo with phone -->
					<!-- <input id="userfile" name="file" accept="image/*" type="file" /> -->

					<!-- take video with phone -->
					<!-- <input id="userfile" name="file" type="file" accept="video/*"/> -->

					<input name="accept" type="hidden" />


					<!-- upload info -->
					<div class="selected-file"></div>
					<div class="progress" style="width: 300px;height: 20px"></div>
					<div class="uploaded-result"></div>
					<if condition="$info['video_path'] neq ''">
						<video width="50%" height="50%" controls="controls" id="myvideo2" src="{$info['video_path']}" style="	" >
							<source id="videoSourceid" src="{$info['video_path']}" type="video/mp4"/>
						</video>
						<else/>
						<video width="50%" height="50%" controls="controls" id="myvideo2" src="" style="display: none" >
							<source id="videoSourceid" src="" type="video/mp4"/>
						</video>
					</if>
				</div>
			</div>





		</fieldset>
		<div class="form-actions">
			<button type="submit" class="btn btn-primary js-ajax-submit">{:L('EDIT')}</button>
			<a class="btn" href="{:U('Video/index')}">{:L('BACK')}</a>
		</div>
	</form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
<script>
    $(function(){
        $("#is_down_2").click(function(){ //是否支持下载,显示
            $("#is_down").attr("style","display:block;");
        });
        $("#is_down_1").click(function(){ //是否支持下载,隐藏
            $("#is_down").attr("style","display:none;");
        });


        $("#is_charge_0").click(function(){ //是否收费，隐藏
            $("#is_charge").attr("style","display:none;");
        });

        $("#is_charge_1").click(function(){ //是否收费，显示
            $("#is_charge").attr("style","display:block;");
        });

    })
</script>
</body>
</html>